<template>
  <div class="car">
    <h2>一辆{{car.brand}}车，价值{{car.price}}万</h2>
    <button @click="changePrice">修改价格</button>
  </div>
</template>

<script setup lang="ts" name="Car">
import {reactive} from 'vue'
  // 数据
  let car = reactive({brand:'奔驰',price:100})
  // 方法
  function changePrice(){
    car.price += 10
  }
</script>

<style scoped>
.car {
  background-color: skyblue;
  box-shadow: 0 0 10px 0;
  padding: 10px;
  border-radius: 10px;
}
</style>